home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10694 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news.telepac.pt!usenet
  2. From: jcarlosr@mail.telepac.pt (J.Carlos)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: NEWBIE QUE.: Compiler calling the wrong function???
  5. Date: Sat, 09 Mar 1996 15:34:48 GMT
  6. Organization: telepac
  7. Message-ID: <4hscga$8tj@vivaldi.telepac.pt>
  8. References: <960302.203405.15824@banshee.uunet.ca>
  9. NNTP-Posting-Host: alv1_p9.telepac.pt
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. ffisl@travel-net.com (Frantisek Fisl) wrote:
  13.  
  14. >When I compile a file containing the following code, I get this error message:
  15. >error C2660: 'GetDlgItem' : function does not take 1 parameters
  16. >void CPlmwinDoc::OnInputBmpNew()
  17. >{
  18. >// HERE'S WHERE THE ERROR OCCURS:
  19. >  itemIndex = ((CComboBox *)GetDlgItem(IDC_BMP))->GetCurSel();
  20. >  ((CComboBox *)GetDlgItem (IDC_BMP))->GetLBText(itemIndex, PTypeText);
  21. >}
  22.     This is a MFC question, not a C++ one ... ,  anyway,
  23. The problem is that MFC's GetDlgItem is a member of CWnd 
  24. (or CView...) class, not CDocument, so you must call GetDlgItem in the
  25. view class or get a pointer to the view in the document class to call
  26. it (check GetNextView() function in MFC documentation).
  27. Regards, J.Carlos
  28.  
  29.  
  30.